program horsejump;

var qi:array[1..50,1..50] of string[20];
    m,n:integer;
    x1,y1,x2,y2:integer;
    total:string;

procedure input;
  var f:text;
  begin
    assign(f,'d:\tq\input.pas');
    reset(f);
    readln(m,n);
    readln(x1,y1);
    readln(x2,y2);
    close(f);
  end;

procedure output;

 begin
   writeln;
   writeln('The total is : ',total);
 end;


function add(x,y:string):string;
  const line='0123456789ABCDEF';
  var a,b,cha,i,r:integer;
      he,sert:string;
      t:integer;
  begin
    a:=length(x);
    b:=length(y);
    cha:=abs(a-b);
    if a>b then
       begin
         for i:=1 to cha do
           y:='0'+y;
       end
           else
       begin
         for i:=1 to cha do
           x:='0'+x;
       end;
    r:=0;
    he:='';
    a:=length(x);
    for i:=a downto 1 do
      begin
        t:=pos(x[i],line)-1+pos(y[i],line)-1+r;
        r:=t div 10;
        t:=t mod 10;
        str(t,sert);
        he:=sert+he;
      end;
      if r<>0 then
        begin
          str(r,sert);
          he:=sert+he;
        end;
    add:=he;
  end;

function pan(a1,b1:integer):boolean;
 var k:boolean;
 begin
   k:=false;
   if (a1<=m)and(b1<=n)and(a1>0)and(b1>0) then k:=true;
   pan:=k;
 end;

procedure dong;
 var i,j:integer;

 begin
   for i:=1 to 50 do
     for j:=1 to 50 do
       qi[i,j]:='0';
   qi[x2,y2]:='1';

   for i:=m-1 downto 2 do
     for j:=n downto 1 do
        begin
          if pan(i+1,j+2) then qi[i,j]:=add(qi[i,j],qi[i+1,j+2]);
          if pan(i+1,j-2) then qi[i,j]:=add(qi[i,j],qi[i+1,j-2]);
          if pan(i+2,j+1) then qi[i,j]:=add(qi[i,j],qi[i+2,j+1]);
          if pan(i+2,j-1) then qi[i,j]:=add(qi[i,j],qi[i+2,j-1]);
        end;
   total:=add(add(qi[x1+1,y1+2],qi[x1+1,y1-2]),add(qi[x1+2,y1+1],qi[x1+2,y1-1]));

 end;

begin
  input;

  dong;
  output;

end.
















